package com.recipedb.recipedb.service.impl;

import com.recipedb.recipedb.entity.RecipeTag;
import com.recipedb.recipedb.entity.RecipeTagId;
import com.recipedb.recipedb.repository.RecipeTagRepository;
import com.recipedb.recipedb.service.RecipeTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;

@Service
public class RecipeTagServiceImpl implements RecipeTagService {

    @Autowired
    private RecipeTagRepository repository;

    @Override
    public RecipeTag save(RecipeTag entity) {
        return repository.save(entity);
    }

    @Override
    public void deleteById(RecipeTagId id) {
        repository.deleteById(id);
    }

    @Override
    public Optional<RecipeTag> findById(RecipeTagId id) {
        return repository.findById(id);
    }

    @Override
    public List<RecipeTag> findAll() {
        return repository.findAll();
    }
}
